<!DOCTYPE html>
<html class="no-js">
<head lang="en">

    <#include "../head_import.html" />

</head>
<body>
<#include "../include/top_nav.html">
    <div class="am-cf admin-main">

        <!-- sidebar start -->
        <#include "../config/left.html">
            <!-- sidebar end -->
            <!-- content start-->
            <div class="admin-content">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><@s.m "global.position"/>: 数据备份 </div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form class="ropt">
                            <input type="button" value="备份" onclick="openDIV()"/>
                        </form>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <@p.form id="tableForm" action="o_dataBackup.do">
                        <input type="hidden" name="password" id="password"/>
                        <input type="hidden" name="id" value="${dataBackup.id!}"/>
                        <@p.td label="数据库路径">
                        <@p.text name="dataBasePath" value="${dataBackup.dataBasePath!}" required="true" class="required"/>
                    </@p.td>
                    <@p.tr/>
                    <@p.td label="地址">
                    <@p.text name="address" value="${dataBackup.address!}" required="true" class="required" help="本机可使用localhost"/>
                </@p.td>
                <@p.tr/>
                <@p.td label="数据库名称">
                <@p.text name="dataBaseName" value="${dataBackup.dataBaseName!}" required="true" class="required"/>
                        </@p.td>
                        <@p.tr/>
                        <@p.td label="用户名">
                        <@p.text name="username" value="${dataBackup.username!}" required="true" class="required"/>
                    </@p.td>
                    <@p.tr/>
                </@p.form>
            </div>
    </div>
    <div class="am-g">
        <div class="am-u-sm-12 am-u-sm-centered">
            <div id="showDIV"
                 style="display: none; z-index: 2; position: absolute; top: 30%; right: 50%; width: 200px; height: 50px; background: #eee; border: 1px solid #000; margin: 0 auto;">
                <div align="center"><input type="hidden" id="hiddenId" />
                    <input type="password" id="pwd" /><br/>
                    <input type="button" onclick="backup()" value="备份" />
                    <input type="button" onclick="closeDIV()" value="关闭" />
                    </div>
                </div>
        </div>
    </div>


    </div>

    </div>

<script type="text/javascript">
function getTableForm() {
	return document.getElementById('tableForm');
}
function closeDIV(){
	document.getElementById("showDIV").style.display="none";
}
function openDIV(){
	document.getElementById("showDIV").style.display="block";
}
function backup(){
	$("#password").val($("#pwd").val());
	closeDIV();
	getTableForm().submit();
}
</script>

<#include "/common/alert_message.html"/>
</body>
</html>